import React from "react"
import { createBrowserRouter } from "react-router-dom"
const App = React.lazy(() => import("../App"))
const Login = React.lazy(() => import("../pages/Login/Login"))
const My = React.lazy(() => import("../pages/My/My"))
const ChatBot = React.lazy(() => import("../pages/newbot/ChatBot"))
const Register = React.lazy(() => import("../pages/Login/Register"))
const Liaotian = React.lazy(() => import('../pages/JBH/Liaotian'))
const Ewm = React.lazy(() => import("../pages/My/Ewm"));
const Sao = React.lazy(() => import("../pages/My/Sao"));
const Deposit= React.lazy(()=>import("../pages/My/Deposit"))
const DepositResult= React.lazy(()=>import("../pages/My/DepositResult"))
const SendAddress = React.lazy(()=>import("../pages/map/SendAddress"))
const RoomList = React.lazy(() => import("../pages/Liu/RoomList"));
const VoiceRoom = React.lazy(() => import("../pages/Liu/voiceRoom"));
const SendList = React.lazy(() => import("../pages/Square/page/SendList"));
const Add = React.lazy(()=>import("../pages/Square/page/Add"))
const Detail = React.lazy(()=>import("../pages/Square/page/Detail"))
const Xiu = React.lazy(()=>import("../pages/My/Xiu"))


// CompanionProfile不应该作为独立路由，应该在ChatBot组件内部使用
// import CompanionProfile from "../pages/newbot/CompanionProfile";

const router = createBrowserRouter([
    {
        path: "/",
        element: <App />,
        children: [
            { path: 'my', element: <My /> },
            { path: 'bot', element: <ChatBot /> },
            { path: 'liaotian', element: <Liaotian></Liaotian> },
            { path: 'sendList' ,element: <SendList></SendList> },
            { path: 'add' ,element: <Add></Add> },
            { path: 'detail' ,element: <Detail></Detail> },
             {
    path: "/rooms",
    element: <RoomList />,
  },
            // 移除companion路由
        ]
    },
    { path: "/login", element: <Login /> },
    { path: "/register", element: <Register /> },
    
     { path: "/er", element: <Ewm></Ewm> },
     { path: "/xiu", element: <Xiu></Xiu> },
     { path: "/sao", element: <Sao></Sao> },
     { path: "/send", element: <SendAddress></SendAddress> },
      {path:"/deposit",element:<Deposit></Deposit>},
    {path:"/my/deposit/result",element:<DepositResult></DepositResult>},
   
   {
    path: "/voiceroom",
    element: <VoiceRoom />
        

  },
])

export default router